package org.zebra.file.excel.core;

import cn.idev.excel.context.AnalysisContext;
import org.zebra.common.util.ValidatorUtil;

/**
 * Excel 导入监听
 *
 * @author zhanghongbin
 */
public class DefaultExcelListener<T> extends ExcelListener<T> {

    public DefaultExcelListener(Boolean isValidate) {
        super(isValidate);
    }

    @Override
    public void invoke(T data, AnalysisContext context) {
        if (isValidate) {
            ValidatorUtil.validate(data);
        }
        excelResult.getList().add(data);
    }
}
